home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / SciAn / src / ScianTextFiles.h < prev    next >
C/C++ Source or Header  |  1994-08-01  |  1KB  |  45 lines

  1. /*ScianTextFiles.h
  2.   Eric Pepke
  3.   24 February 1993
  4.  
  5.   External stuff for ScianTextFiles.c
  6. */
  7.  
  8. #define TEXTLINEALLOCCHUNK    200
  9.  
  10. typedef int TextFlagsTyp;
  11. #define TF_READ        1    /*Read from file*/
  12. #define TF_HASHCOMMENTS    8    /*Comments beginning with a hash in first line*/
  13. #define TF_CONTINUATION    16    /*Honor continuation by \ at end of line*/
  14. #define TF_INCLUDENL    32    /*Include new lines, else remove them*/
  15.  
  16. typedef struct textfile
  17.     {
  18.     struct textfile *next;    /*Pointer to next file*/
  19.     char *name;        /*Name of the file*/
  20.     FILE *filePtr;        /*File pointer*/
  21.     int lineNum;        /*Number of last line read*/
  22.     char *curLine;        /*Pointer to the current line read*/
  23.     long nAlloc;        /*Number of characters allocated*/
  24.     TextFlagsTyp flags;    /*Flags for the file*/
  25.     Bool eof;        /*True iff at eof*/
  26.     } TextFile, *TextFilePtr;
  27.  
  28. #ifdef PROTO
  29. void InitTextFiles(void);
  30. TextFilePtr OpenTextFile(char *name, TextFlagsTyp flags);
  31. char *GetCurLine(TextFilePtr textFile);
  32. char *GetNextLine(TextFilePtr textFile);
  33. void CurLineError(TextFilePtr textFile, char *message, char *begin, char *end);
  34. void CloseTextFile(TextFilePtr textFile);
  35. void KillTextFiles(void);
  36. #else
  37. void InitTextFiles();
  38. TextFilePtr OpenTextFile();
  39. char *GetCurLine();
  40. char *GetNextLine();
  41. void CurLineError();
  42. void CloseTextFile();
  43. void KillTextFiles();
  44. #endif
  45.